/*************************************************************************
	> File Name: P1765.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-04-16 14:52:01
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    string key[10] = {
        " ", " ", "abc", "def",
        "ghi", "jkl", "mno",
        "pqrs", "tuv", "wxyz"
    };
    int mp[26] = {0};
    for (int i = 2; i <= 9; i++) {
        for (int j = 0; j < key[i].size(); j++) {
            mp[key[i][j] - 'a'] = j + 1;
        }
    }
    string str;
    getline(cin, str);
    int cnt = 0;
    for (int i = 0; i < str.size(); i++) {
        if (str[i] == ' ') cnt++;
        else {
            cnt += mp[str[i] - 'a'];
        }
    }
    cout << cnt << endl;
    return 0;
}
